import { baseUrlConfig } from '@/config/config';
import request from '@/utils/request'

const bastPath = baseUrlConfig.processBaseUrl

export interface PageListType {
  pageNum?: number;
  pageSize?: number;
  condition: {
    isDisable?: string;
    goodsType?: string;
    classifyCode?: string;
    timeStart?: string;
    timeEnd?: string;
  }
}

// 获取分页列表
export const goodsTypePageList = (data: PageListType) => {
  return request({
    url: bastPath + '/lose/goodsType/find/page',
    method: 'post',
    data
  })
}
// 导出物品类型

export const goodsTypeExportXls = (data: PageListType) => {
  return request({
    url: bastPath + '/lose/goodsType/exportXls',
    method: 'post',
    data,
    responseType: 'blob'
  })
}

// 新增
export const goodsTypeAppend = (data: any) => {
  return request({
    url: bastPath + '/lose/goodsType/append',
    method: 'post',
    data
  })
}

// 更新
export const goodsTypeUpdate = (data: any) => {
  return request({
    url: bastPath + '/lose/goodsType/update',
    method: 'post',
    data
  })
}

// 删除
export const goodsTypeDelete = (data: any) => {
  return request({
    url: bastPath + '/lose/goodsType/delete',
    method: 'post',
    data
  })
}

// 获取列表
export const goodsTypeList = (data: any) => {
  return request({
    url: bastPath + '/lose/goodsType/find',
    method: 'post',
    data
  })
}
